package com.fuhe.chen.vendingmachine.alipay;

import java.io.FileWriter;
import java.io.IOException;

/**
 * 支付宝相关参数
 */
public class AlipayConfig {

    // 商户appid
    public static String APPID = "2021001163675262";
    // 私钥 pkcs8格式的
    public static String RSA_PRIVATE_KEY = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDH7scwZe3q+aJJtFBDKyAL3MEXAFt+sK2QmdiL+tRL2KPkvDmWEbQTJUOnCBJSkDZZx3/qxL7U9+bnDM16WbQSu56dAFX96mqpeTPWG5jlOP0I3u9gc3O8o3GQFVlNqgcCsLcqX5N5vUeqDkAhCt9r8X/oIa3FdX9VKFvboTjm8tibG146EkNye7kkHBNqwq3QkrxFlbmj5wHsxf7eKRK1ZJlPgfS3u0LX8t130mHwjhnK6ORJYEKIWOWFf7xKwMeDkXEZ1nFqhVdJhp4dAlEFk+HoxsvnzkcBHP/FajXinVr7+s8xdyh7RgKRhgu1RrrZqM/GrXQk8lgheui76MXZAgMBAAECggEAOeMBmxq4AwOaIFrrrjbrRWP6KA27b/f5mNdiYk0ScI9eDJkO10ty5uQwLUlh/LOyeNYRTEkAs6q/GQCU8arNP2tBJlX1j9nyXfUws/ozj5KreIkLp9JlnSV5eO0leR4Uf4vozIT1rxbFjBAqMybxv1Ah53Tw2i4F2wMfbXzFe+AqI+NwUPUZGUO1/VrwziXm8exn4byg8YYxRB33PaXRIWmS3X0O2XGcCYEBOhGxuhgK0QehOvZfP0Bz8Clc+/PvaUDtWOOSjaKVIVkBIyaExXBZo8el4+2JWe00A02E8dqM2KzKng2w9r01bO+Iobs8PSFvRZ85RaglpL8GYbGUzQKBgQD/7LypxRoWUSFEM5dObjy69TKZBnzhUMAsGRZdARSLzp5FrmM2hIZVzpxftpvOSs0c2NJ5C138LQ8YscE4jP4ukTlm71oIhOTOik4shdWJfdx6AMFzH7zBa8lWAiSD3G3O0tr8MuO14vfVZOn+3uO6KinpC6cjvIxXbOcvQZjJPwKBgQDH/dOh5p2e+sitq40lPyJoV7wf+sh0MHagXqGYqusSHdLiKmIMFE4fFpKIIO+dUt2XU8Jx2FRMyJmV/VkEPi+ruWRZasmIybYjGnmIiZETaBPOw2a4DN53aTq0bXyMWd3Ok3EURKIBMZDV3oWNYVmuNRsWEj138Heos8Iv8ytS5wKBgGJTNwzWwDYQx4InfBtS+RwvNlhaiMIcPyjyHohu8NDh+ib1YALDGcV/0s5nHyc7z+AkYYDF4D8RpLotGPo8GTAU9YPZs7KQNEQyGOS8KpVfeMSa47fyWpfJbJoRyquqlbmfgyjf+GKaJ/OhiNE2GzIcHuv9YSK2vwibu5qJTkULAoGACntwWz0GJ+4HFKs4M6qSeBuZHaf8V7KulQtAtwrGVWXAxt/n0bBCw/hf58iqJnnQaX0XZPYsvPWKr0TfJIzJ3NtTuigRthy0cjSSCCkFtJmw6BZvzNfH1URrskdGzuhq6sfplmFeiGd7quoF3/opRCs+ZzK/jAjLjMkXNYIuVCMCgYAwZM3ecSYKcP6ySM91I26DHvufgN6/7YNST2WpGs9klSWu7/3aRAjR/gSmgncje76ccu63JdizIDNQCKQqzpwFPywIv9oxFRk2m9cPaCCwf6knB9GVbRMV/aUaW0IKBd3xXHpuM21ZuCAyfGufVQ/GcbBiTcDcL7+iNt/3Ps7DvA==";
    // 服务器异步通知页面路径 需http://或者https://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "https://vm.fowotek.com/getNotify";

    public static String web_notify_url = "https://vm.fowotek.com/getAppNotify";
    // 页面跳转同步通知页面路径 需http://或者https://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问 商户可以自定义同步跳转地址
    public static String return_url = "https://vm.fowotek.com/getReturn";
    // 请求网关地址
    public static String URL = "https://openapi.alipay.com/gateway.do";
    // 编码
    public static String CHARSET = "utf-8";
    // 返回格式
    public static String FORMAT = "json";
    // 支付宝公钥
    public static String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjh53WYZFWt2OkixkU3sKzn8TxmqnlJvcG9YQAuLHIFzIB6Zyxzu2Wgmr2JAiRp2SaS79Ls+RNk6MXIo43DoLN9oflhFRv5iiSpcla/Q3Id4xzJS1ANmLrR/FyDAGUro00sCEFi0J1w3BYGcuwUblj9ZPIXvdgE8abn6AHtJPkjgKiQ3xkgMeKSzCDk08+3I63kiXZxRri97EJopojG40UaAcQ8hGVzUrsm7FIXvyBiN8m680YMSuqafaCC88MS6E58ryvwPZVBXzg5R/kki3hdrYkwGUcUY7R/P0Nw8jkw92EoXZcXLSFAi9c2m9FDOBQn6iUPhtoMtoBa+dzXh+lwIDAQAB";
    // 日志记录目录
    public static String log_path = "/log";
    // RSA2
    public static String SIGNTYPE = "RSA2";
    // 超时时间
    public static String EXPIRE = "2m";


    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
